package com.ruoyi.common.enums;

/**
 * 付费状态枚举
 * @author lisongtao
 * @date 2023/11/2 15:39
 */
public enum PaymentStatusEnum {

    UNPAID_PAYMENT("1", "未缴费"), PAID("2", "已缴费"),
    INABILITY_TO_PAY("3", "缴费异常"), CARD_ERROR("4", "卡片异常"),
    UNDER_PAY("5", "支付中");

    private final String code;
    private final String info;

    PaymentStatusEnum(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    public static PaymentStatusEnum getPaymentStatusEnum(String code) {
        PaymentStatusEnum userTypeEnum = null;
        for (PaymentStatusEnum value : values()) {
            if (code.equals(value.getCode())) {
                userTypeEnum = value;
            }
        }
        return userTypeEnum;
    }

}
